1. Field of the Invention
Methods and apparatuses consistent with the present invention generally relate to video encoding and decoding, and more particularly, to accurately predicting a motion vector of the current block in the encoding of the current block.
2. Description of the Related Art
In video compression standards such as moving picture expert group (MPEG)-1, MPEG-2, MPEG-4, H.264/MPEG-4, AVC (Advanced Video Coding) standards, a picture is divided into macroblocks for video encoding. Each of the macroblocks is then encoded using inter prediction or intra prediction. Next, an optimal encoding mode is selected based on the size of data of the encoded macroblock and the degree of distortion between the encoded macroblock and the original macroblock and the macroblock is encoded in the selected encoding mode.
Video encoding using inter prediction compresses video by removing temporal redundancy between pictures, a representative example of which is motion-estimation encoding. Motion-estimation encoding estimates motion of the current picture block-by-block using at least one reference picture and compensates for the estimated motion, thereby encoding a video.
In motion-estimation encoding, a block that is most similar to the current block is searched for in a predetermined search range of a reference picture using a predetermined measurement function. Once the most similar block is found, only a residue between the current block and the most similar block of the reference picture is transmitted, thereby improving the compression rate of video data. For encoding, blocks of various sizes such as 16×16, 8×16, 8×8, and the like may be used.
In order to decode the motion-estimation encoded current block, information regarding a motion vector indicating a displacement between the current block and the most similar block of the reference picture is required. Thus, the information regarding the motion vector is encoded and inserted into a bitstream during encoding. However, if the information regarding the motion vector is encoded and inserted without being separately processed, overhead increases and thus the compression rate of video data is reduced.
To solve the problem, motion-estimation encoding predicts a motion vector of the current block using neighboring blocks around the current block and encodes and transmits only a differential value between a prediction motion vector generated by the prediction and the original motion vector, thereby compressing the information regarding the motion vector. Estimation of the motion vector of the current block using neighboring blocks will be described in more detail with reference to FIGS. 1A through 1D.
FIGS. 1A through 1D illustrate prediction of a motion vector according to the prior art. In FIGS. 1A through 1D, a motion vector of a current block 110 is predicted according to the H.264, standard.
In FIG. 1A, the current block 110 is the same as its neighboring blocks 121 through 123 in size. In this case, according to H.264, a prediction motion vector, which is a prediction value of the motion vector of the current block 110, is determined by “prediction motion vector=median value (mvA, mvB, mvC)”. Adjacent blocks are likely to be similar to each other and thus the motion vector of the current block 110 is determined as a median value of motion vectors of the neighboring blocks 121 through 123 around the current block 110.
In FIG. 1B, the current block 110 and its neighboring blocks 131 through 133 have different sizes. In this case, a median value of a motion vector of an uppermost block 131 among neighboring blocks located to the left of the current block 110, a motion vector of a leftmost block 132 among neighboring blocks located above the current block 110, and a motion vector of a leftmost block 132 among neighboring blocks located above and to the right of the current block 110 is determined as the prediction motion vector of the current block 110.
In FIG. 1C, the current block is not square in shape and is an 8×16, block.
When a left portion 111 of a square block including portions 111 and 112 is the current block, a motion vector of a neighboring block 141 located to the left of the current block 111 is determined as the prediction motion vector of the current block 111. On the other hand, when a right portion 112 of the square block is the current block, a motion vector of a neighboring block 142 located above and to the right of the current block 112 is determined as the prediction motion vector of the current block 112.
In FIG. 1D, the current block is not a square block and is a 16×8, block.
When a lower portion 113 of a square block including portions 113 and 114 is the current block, a motion vector of a neighboring block 151 located to the left of the current block 113 is determined as the prediction motion vector of the current block 113. When an upper portion 114 of the square block is the current block, a motion vector of a neighboring block 152 located above the current block 114 is determined as the prediction motion vector of the current block 114.
As illustrated in FIGS. 1A through 1D, according to the H.164, standard, the prediction motion vector of the current block is determined based on motion vectors of neighboring blocks around the current block. In other words, the motion vector of the current block is predicted using similarity between adjacent blocks.
Once the prediction motion vector of the current block is determined, a differential value between the prediction motion vector of the current block and the true motion vector of the current block is encoded and inserted into a bitstream. By encoding and then transmitting only the differential value instead of transmitting the information regarding the motion vector, the compression rate of video data can be improved.
However, the prediction motion vector obtained based on neighboring blocks may not be an appropriate prediction value of the motion vector of the current block. The compression rate of video data can be improved only when the prediction motion vector is not much different from the true motion vector. However, if the prediction motion vector is a wrong prediction value and thus the differential value is large, the compression rate of video data is reduced.
Therefore, there is a need for a motion vector prediction method capable of accurately generating a prediction motion vector in order to reduce a differential value between the prediction motion vector and a true motion vector.